var poll_id = 0,
    poll_answer_id = "",
    is_being_voted = !1;
pollsL10n.show_loading = parseInt(pollsL10n.show_loading);
pollsL10n.show_fading = parseInt(pollsL10n.show_fading);
console.log(is_being_voted);
function sdu_vote(a,b){
    poll_id=a;
    poll_answer_id = b;
    //poll_process();
}

function poll_process() { jQuery(document).ready(function(b) { poll_nonce = b("#poll_" + poll_id + "_nonce").val();
        b.ajax({ type: "POST", xhrFields: { withCredentials: !0 }, url: pollsL10n.ajax_url, data: "action=polls&view=process&poll_id=" + poll_id + "&poll_" + poll_id + "=" + poll_answer_id + "&poll_" + poll_id + "_nonce=" + poll_nonce, cache: !1, success: poll_process_success }) }) }



function poll_result(b) { jQuery(document).ready(function(a) { is_being_voted ? alert(pollsL10n.text_wait) : (set_is_being_voted(!0), poll_id = b, poll_nonce = a("#poll_" + poll_id + "_nonce").val(),  a.ajax({ type: "POST", xhrFields: { withCredentials: !0 }, url: pollsL10n.ajax_url, data: "action=polls&view=result&poll_id=" + poll_id + "&poll_" + poll_id + "_nonce=" + poll_nonce, cache: !1, success: poll_process_success })) }) }

function poll_booth(b) { jQuery(document).ready(function(a) { is_being_voted ? alert(pollsL10n.text_wait) : (set_is_being_voted(!0), poll_id = b, poll_nonce = a("#poll_" + poll_id + "_nonce").val(),  a.ajax({ type: "POST", xhrFields: { withCredentials: !0 }, url: pollsL10n.ajax_url, data: "action=polls&view=booth&poll_id=" + poll_id + "&poll_" + poll_id + "_nonce=" + poll_nonce, cache: !1, success: poll_process_success })) }) }
function poll_process_success(b) { jQuery(document).ready(function(a) { 
        if(b==1){
            alert('您已经投过票了！');
        }else{
            alert("投票成功！")
            a("#polls-" + poll_id).replaceWith(b);
        }
		
    }) 
}

function set_is_being_voted(b) { is_being_voted = b };